home *** CD-ROM | disk | FTP | other *** search
- Path: news.tte.vtt.fi!newsmaster
- From: Ali Lattunen <Ali.Lattunen@vtt.fi>
- Newsgroups: comp.lang.c++
- Subject: Template function declaration?
- Date: 12 Jan 1996 10:22:18 GMT
- Organization: VTT Information Technology
- Message-ID: <4d5coq$em1@hemuli.tte.vtt.fi>
- NNTP-Posting-Host: tte2053.tte.vtt.fi
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
-
-
- Hi there!
-
- I have a simple question for you experts:
- How to declare a template function in another module?
- Let's say we have a template function max in file foo.cpp
-
- template<class T> T max( T a, T b ) {
- return (a>b) ? a : b;
- }
-
- Then we want to use this function in file bar.cpp. What syntax
- does the declaration have?
-
- I'm pretty new with templates. Can you recommend any book
- concerning programming c++ templates?
-
- Ali Lattunen
- VTT Information Technology
- Telecommunications
- P.O. Box 1202
- FIN-02044 ESPOO
- Finland
-
-